package com.dsh.userSetting.controller;

import com.dsh.model.Result;
import com.dsh.storeManagement.entity.vo.AdminFranchiseLevelVo;
import com.dsh.userSetting.entity.IntegralObtainingMethod;
import com.dsh.userSetting.entity.dto.AdminIntegralRuleDto;
import com.dsh.userSetting.entity.vo.AdminIntegralRuleVo;
import com.dsh.userSetting.service.AdminIntegralRuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 用户设置权限规则(AdminIntegralRule)表控制层
 *
 * @author makejava
 * @since 2022-05-10 11:42:53
 */
@Api(tags = "积分规则")
@RestController
@RequestMapping("adminIntegralRule")
public class AdminIntegralRuleController {
    /**
     * 服务对象
     */
    @Resource
    private AdminIntegralRuleService adminIntegralRuleService;

    /**
     * 通过主键查询单条数据
     *
     * @return 单条数据
     */
//    @GetMapping("selectOne")
//    public AdminIntegralRule selectOne(Integer id) {
//
//        return this.adminIntegralRuleService.queryById(id);
//    }
    @ApiOperation("增加规则")
    @PostMapping("updateRole")
    public Result updateRole(AdminIntegralRuleDto adminIntegralRuleDto){
        AdminIntegralRuleVo adminIntegralRuleVo = adminIntegralRuleService.updateRole(adminIntegralRuleDto);
        return Result.success(adminIntegralRuleVo,"");
    }
//    @GetMapping("findAll")
//    public Result findAll(){
//        AdminIntegralRuleVo all = adminIntegralRuleService.findAll();
//        return Result.success(all,"");
//    }
@ApiOperation("增加获取方法规则")
@PostMapping("updateMother")
public Result updateMother(IntegralObtainingMethod integralObtainingMethod){
    IntegralObtainingMethod integralObtainingMethod1 = adminIntegralRuleService.updateMother(integralObtainingMethod);
    return Result.success(integralObtainingMethod1,"");
}


}